<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<!--①注意head是否有样式冲突，引入需要的css文件-->
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link th:href="@{favicon.ico}" rel="shortcut icon"/>
    <link th:href="@{/css/bootstrap.min14ed.css?v=3.3.6}" rel="stylesheet"/>
    <link th:href="@{/css/font-awesome.min93e3.css?v=4.4.0}" rel="stylesheet"/>
    <link th:href="@{/css/animate.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/plugins/simditor/simditor.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/style.min862f.css?v=4.1.0}" rel="stylesheet"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-areaGrouping-add">

        <div class="form-group">
            <label class="col-sm-3 control-label">分组编号：</label>
            <div class="col-sm-8">
                <input id="aid" name="aid" class="form-control" type="text" placeholder="请输入分组编号">
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 市级01，区级0101，街道010101，村级01010101，组级0101010101</span>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">父级编号：</label>
            <div class="col-sm-8">
                <input id="parentaid" name="parentaid" class="form-control" type="text" disabled>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">地域名称：</label>
            <div class="col-sm-8">
                <input id="aname" name="aname" class="form-control" type="text" placeholder="请输入终端安装地点">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
<!--                <textarea id="note" name="note"  autofocus></textarea>-->
                <input id="note" name="note" class="form-control" type="text">
            </div>
        </div>

    </form>
</div>
<div th:include="include::footer"></div>

<script th:src="@{/js/plugins/dropzone/dropzone.js}"></script>
<script th:src="@{/js/jquery-form.js}"></script>
<script type="text/javascript">
    var prefix = ctx + "broad/areaGrouping";
    $("#form-areaGrouping-add").validate({
        rules:{
            aid:{required:true,},
        },
        messages:{
            // aid:"市级01，区级0101，街道010101，村级01010101，组级0101010101"
        }
    });

    $("#aid").change(function (value) {
        var aid = $("#aid").val()
        if(aid.length>2){
            $("#parentaid").val(aid.substr(0,aid.length-2))
        }else{
            $("#parentaid").val("0")
        }

    })

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-areaGrouping-add').serialize());
        }
    }

</script>
<script th:src="@{/js/plugins/layer/layui-v2.4.5/layui/layui.js}"></script>
<!--与富文本框有关的js文件的引入-->
<script th:src="@{/js/plugins/simditor/module.js}"></script>
<script th:src="@{/js/plugins/simditor/uploader.js}"></script>
<script th:src="@{/js/plugins/simditor/hotkeys.js}"></script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<script th:src="@{/js/plugins/simditor/simditor.js}"></script>

</body>
</html>
